package com.headStorm.timeUse;

import javax.xml.transform.Source;
import java.util.Timer;
import java.util.TimerTask;
import java.util.concurrent.atomic.AtomicInteger;

public class TimerUseDemo {

    public static Timer timer = new Timer();

    public static AtomicInteger atomicInteger = new AtomicInteger(0);

    public static void main(String[] args) {
//        timer.schedule(new TimerTask() {
//               @Override
//               public void run() {
//                   int andIncrement = atomicInteger.getAndIncrement();
//                   if(andIncrement == 2){
//                        System.out.println("-------");
//                        timer.cancel();
//                   }
//                   System.out.println("IMP 当前时间" + this.scheduledExecutionTime()+" "+andIncrement);
//               }
//          }, 0,2000);
        System.out.println("{".getBytes()[0]);
    }
}
